﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Public.Master" AutoEventWireup="true" CodeBehind="ConfigureDatabase.aspx.cs" Inherits="Cms.Web.UI.ConfigureDatabase" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript">
        //<![CDATA[
        function showTestingConnection() {
            document.getElementById("testingConnection").style.display = "";
            var error = document.getElementById("ctl00_body_pnlError");
            if (error != null)
                error.style.display = "none";
        }
        //]]>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    Welcome!
    <br />
    <div class="horizontalDivider" style="margin-bottom: 10px; margin-top: 10px;"></div>
    <asp:UpdatePanel ID="upnlInstall" runat="server">
        <ContentTemplate>
            <cms:LocalizedLiteral ID="llDatabaseType" runat="server" />:&nbsp;&nbsp;
            <asp:DropDownList ID="ddlDatabaseTypes" runat="server" AutoPostBack="true">
                <asp:ListItem Value="SqlServer2008" Selected="True">Microsoft SQL Server 2008</asp:ListItem>
                <asp:ListItem Value="SqlServer2005">Microsoft SQL Server 2005</asp:ListItem>
                <asp:ListItem Value="SqlServer2000">Microsoft SQL Server 2000</asp:ListItem>
            </asp:DropDownList>
            <div class="horizontalDivider" style="margin-bottom: 10px; margin-top: 10px;"></div>
            <asp:Panel ID="pnlServer" runat="server">
                <table style="margin-left: -2px;">
                    <tr id="trSqlServerConnectionType" runat="server">
                        <td><cms:LocalizedLiteral ID="llSqlServerConnectionType" runat="server" />:&nbsp;&nbsp;</td>
                        <td>
                            <asp:DropDownList ID="ddlSqlServerConnectionTypes" runat="server" AutoPostBack="true">
                                <asp:ListItem Value="Standard" Selected="True">Standard Security Connection</asp:ListItem>
                                <asp:ListItem Value="Trusted">Trusted Connection</asp:ListItem>
                                <asp:ListItem Value="IpAddress">IP Address Connection</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llServer" runat="server" />:&nbsp;&nbsp;</td>
                        <td><asp:TextBox ID="txtServer" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llDatabase" runat="server" />:&nbsp;&nbsp;</td>
                        <td><asp:TextBox ID="txtDatabase" runat="server" /></td>
                    </tr>
                    <tr id="trUsername" runat="server">
                        <td><cms:LocalizedLiteral ID="llUsername" runat="server" />:&nbsp;&nbsp;</td>
                        <td><asp:TextBox ID="txtUsername" runat="server" /></td>
                    </tr>
                    <tr id="trPassword" runat="server">
                        <td><cms:LocalizedLiteral ID="llPassword" runat="server" />:&nbsp;&nbsp;</td>
                        <td><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" /></td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlFile" runat="server" Visible="false">
                <p><cms:LocalizedLiteral ID="llEnterPhysicalDatabaseFilePath" runat="server" /></p>
                <asp:TextBox ID="txtPath" runat="server" Width="400" />
                <br />
                <p><cms:LocalizedLiteral ID="llCurrentPath" runat="server" />:</p>
                <strong><asp:Literal ID="litApplicationPath" runat="server" /></strong>
            </asp:Panel>
            <div class="horizontalDivider" style="margin-bottom: 10px; margin-top: 10px;"></div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="testingConnection" style="display: none; margin-bottom: 10px;">
        <strong><cms:LocalizedLiteral ID="llTestingConnection" runat="server" /></strong>
    </div>
    <asp:Panel ID="pnlError" runat="server" Visible="false" style="margin-bottom: 10px; color: #aa2200;">
        <strong><cms:LocalizedLiteral ID="llConnectionError" runat="server" /></strong>
    </asp:Panel>
    <asp:linkbutton ID="lbConfigure" Runat="server" OnClick="lbConfigure_Click" CssClass="orangeButton" OnClientClick="showTestingConnection();"><span><span><img src="Admin/Img/icons/database_start.png" alt="" /><span><cms:LocalizedLiteral ID="llConfigureDatabase" runat="server" /></span></span></span></asp:linkbutton>
    <asp:Panel ID="pnlManualRestart" runat="server" Visible="false">
        <a href="ConfigureDatabase.aspx?action=CreateDatabase">Restart ASP.NET and click here to continue...</a>
    </asp:Panel>
</asp:Content>
